473,545 Members | 1,797 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Collapse tree menu using dom???

I am confused on childNodes or children. When you have nested lists,
I would think it would all be one list in the Dom, this doesn't seem
to be the case. So how do you traverse an unordered list? Any help
appreciated. John

In the below script, I can expand and contract the nodes when clicked
on, but I want the menu to close all other siblings to the node
clicked so that only one sub menu option is expanded at one time. If
the node display is being set to none, I would also like it to
collapse all the sub nodes.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
#level_1, #level_2, #level_3, #level_4 {
cursor:pointer;
cursor:hand;
font-weight:normal;
list-style-image:url(plus. gif);
color:#003366;
padding-bottom:5px;
}
..folderheader, .folderlist {
display:none;
}
..folderlist {
list-style-image:url(repor t.gif);
}
LI {
padding-left:2px;
}
a:visited {
color: #003366;
}
a:hover {
color: #663333;
}
a:active {
color: #003366;
}
a:link {
color: #003366;
}
..style1 {
font-size: 14pt;
font-weight: bold;
}
body {
margin-left: 15px;
}
</style>
<script language="javas cript" type="text/javascript">
var head="display:' '"
img1=new Image()
img1.src="plus. gif"
img2=new Image()
img2.src="minus .gif"

function showMenu(){
var elm=event.srcEl ement;
//unsure how to best traverse the dom here in a list
var myMenuLength;
//for(i=0;i<myMen uLength;i++){

//}

//expands or contracts the nodes clicked on
if(elm.id && elm.id.indexOf( 'level') > -1){
if (elm.childNodes (1).currentStyl e.display=="non e"){
elm.childNodes( 1).style.displa y="block"
elm.style.listS tyleImage="url( minus.gif)"
}
else{
elm.childNodes( 1).style.displa y="none"
elm.style.listS tyleImage="url( plus.gif)"
}
}
}
document.onclic k=showMenu;
</script>
</head>
<body>
<ul id="mainmenu">
<li id="level_1">Me nu 1
<ul class="folderhe ader">
<li id="level_2">Re port Types
<ul class="folderhe ader">
<li id="level_3">Re ports 1
<ul class="folderhe ader">
<li id="level_4">Re port Name
<ul class="folderli st">
<li>Add New Record</li>
<li>Edit Records</li>
<li>Clone Records</li>
</ul>
</li>
<li id="level_4">Re port Name
<ul class="folderli st">
<li>Add New Record</li>
<li>Edit Records</li>
<li>Mass Update</li>
<li>Clone Records</li>
</ul>
</li>
</ul>
</li>
<li id="level_3">Re ports 2
<ul class="folderhe ader">
<li id="level_4">Re port Name
<ul class="folderli st">
<li>Add New Record</li>
<li>Edit Records</li>
<li>Mass Update</li>
<li>Clone Records</li>
</ul>
</li>
<li id="level_4">Re port Name
<ul class="folderli st">
<li>Add New Record</li>
<li>Edit Records</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li id="level_1">Me nu 2
<ul class="folderhe ader">
<li id="level_2">Re port Name
<ul class="folderli st">
<li>Add New Record</li>
<li>Edit Records</li>
</ul>
</li>
</ul>
</li>
</ul>
</body>
</html>
Jul 23 '05 #1
7 2970
johkar wrote:
I am confused on childNodes or children. When you have nested lists,
I would think it would all be one list in the Dom, this doesn't seem
to be the case. So how do you traverse an unordered list? Any help


element.childNo des returns the direct children of a element
as an array, it does not return the children of the
children. When the user clicks on a menu item, you need to
do something like (untested - for illustration only):

var a = <clickedNode>.c hildNodes;
for (var i=0; i<a.length; ++i) {
a[i].style.display = '';
}

As the user goes down each level, you then display the
children of each node clicked on. Once the user selects
something at the end of a branch, you then can either:

Remember all the nodes you displayed and explicity
un-display them (hideous! don't try it!) or simply travel
down the branch recursively from the top and un-display all
childNodes whether they were displayed or not (simple).

Here is a recursion routine supplied by Ryan Stewart in a
post here:

news://inetbws1.citec.qld.gov.au:119...**@comcast.com

Where Ryan has "out += node.nodeName + '\n';"

put in your code to undisplay the node, similar to:

n.style.display = 'none';

Here's the script:

<script type="text/javascript">
var out = "";
function listNodes(n) {
out += n.nodeName + "\n";
for (var i=0; i<n.childNodes. length; ++i) {
listNodes(n.chi ldNodes[i]);
}
}
listNodes(docum ent.getElementB yId("listMe"));
alert(out);
</script>
Good luck - Fred.
Jul 23 '05 #2
RobG wrote:
johkar wrote:
I am confused on childNodes or children. When you have nested lists,
I would think it would all be one list in the Dom, this doesn't seem
to be the case. So how do you traverse an unordered list? Any help

element.childNo des returns the direct children of a element as an array,
it does not return the children of the children. When the user clicks on
a menu item, you need to do something like (untested - for illustration
only):

[snip] you then can either:

Remember all the nodes you displayed and explicity un-display them
(hideous! don't try it!) or simply travel down the branch recursively
from the top and un-display all childNodes whether they were displayed
or not (simple).

Good start Rob, I've had a play and come up with the following lightly
tested collapsing menus.

They are hidden with JS so work if JS is turned off. Just add links as
required, presumably they'd bring up content in an iFrame. The only
decision is whether to leave the menus extended when a link is clicked
on (my preference as it acts as a kind of breadcrumb) or to reset them.

I've included an example with the following.

They could be further optimised by not going down the tree if the UL is
already hidden, but hardly seems worth it if the menues are small. The
script only hides ULs, not anything else but that effectively hides all
the children of the UL.

Watch for wrapping...

<html>
<head><title>Co llapsing Menu Example</title>
<meta name="Date" content="2004-10-05">
<meta name="Author" content="Fred Oz">
<script type="text/javascript">

// Handle menu click
function mClick(n) {

// Go up to LI or UL, whichever comes first
// Will always be LI except on load when will be UL
while (n.nodeName != 'LI' && n.nodeName != 'UL') {
n = n.parentNode;
}

// remember node
var n0 = n;

// Go up to UL if stopped at LI above
while (n.nodeName != 'UL') {
n = n.parentNode;
}

// Make children of all sibling UL's hidden
// Do not hide kids of node clicked on
// to prevent flashing off & on
var o = n.childNodes;
for (var i=0; i<o.length; ++i) {
if (0[i] != n0) hideUL(o[i]);
}

// Make children of node clicked on visible
for (var k=0; k<n0.childNodes .length; ++k) {
if (n0.childNodes[k].style) n0.childNodes[k].style.display= '';
}
}

function hideUL(x) {
// Hide UL
if (x.nodeName == 'UL') x.style.display ='none';

// Recurse down tree, hiding all ULs
for (var j=0; j<x.childNodes. length; ++j) {
hideUL(x.childN odes[j]);
}
}

// Not really needed, see note below
function resetMenu() {
mClick(document .getElementById ("menu0"));
}

</script>

</head>

<body>
<!-- Menus start here -->

<ul id="menu0">
<li><a href="#" onclick="mClick (this)">menu 0 Level 0</a>
<ul id="menu1">
<li><a href="#" onclick="mClick (this)">menu 0 Level 0 Level 0</a>
<ul>
<li>menu 0 Level 0 Level 0 Level 0</li>
<li>menu 0 Level 0 Level 0 Level 1</li>
<li><a href="#" onclick="
alert('About to reset the menu,'
+ '\nI don\'t like this behaviour');
resetMenu();
">menu 0 Level 0 Level 0 Level 2</a></li>
</ul
</li>

<li><a href="#" onclick="mClick (this);">menu 0 Level 0 Level 1</a>
<ul>
<li>menu 0 Level 0 Level 1 Level 0</li>
<li>menu 0 Level 0 Level 1 Level 1</li>
<li>menu 0 Level 0 Level 1 Level 2</li>
</ul
</li>
</ul>
</li>
<li><a href="#" onclick="mClick (this)">menu 0 Level 1</a>
<ul>
<li><a href="#" onclick="mClick (this)">menu 0 Level 1 Level 0</a>
<ul>
<li>menu 0 Level 1 Level 0 Level 0</li>
<li>menu 0 Level 1 Level 0 Level 1</li>
<li>menu 0 Level 1 Level 0 Level 2</li>
</ul
</li>
<li><a href="#" onclick="mClick (this)">menu 0 Level 1 Level 1</a>
<ul>
<li>menu 0 Level 1 Level 1 Level 0</li>
<li>menu 0 Level 1 Level 1 Level 1</li>
<li>menu 0 Level 1 Level 1 Level 2</li>
</ul
</li>
</ul>
</li>
</ul>

<!-- Hide menus -->

<!--
If not intending to reset menus when link clicked
put the reset code here and get rid of resetMenu()
-->

<script type="text/javascript">
resetMenu();
</script>

<!-- Menus end here, put content below -->

</body>
</html>
Jul 23 '05 #3
Thank you for the reply. FYI, I did have to change childnodes to
childNodes in a couple of places. I don't fully understand this script
yet. When I tried to add even more submenus as in my original example,
it errored out. I am still looking at the script. Any pointers?

John

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 23 '05 #4
johkar N wrote:
Thank you for the reply. FYI, I did have to change childnodes to
childNodes in a couple of places. I don't fully understand this script
yet. When I tried to add even more submenus as in my original example,
it errored out. I am still looking at the script. Any pointers?

John


I tested the script I supplied up to 5 levels deep with about 40 items
and it works in a flash on my ancient Machine. The HTML gets a bit
unweildy, check your markup thoroughly.

My code uses exactly the same function call every time and only requires
one LI or UL at the top to have an id, the rest don't need one. There
are probably some tricks you can do with CSS to optimise it further.

Cheers, Fred.
Jul 23 '05 #5
johkar N wrote:
Thank you for the reply. FYI, I did have to change childnodes to
childNodes in a couple of places. I don't fully understand this script
yet. When I tried to add even more submenus as in my original example,
it errored out. I am still looking at the script. Any pointers?


I simply applied Fred's

<a href="#" onclick="mClick (this)"> stuff </a>

to each header in your orginal stuff and it worked fine (see
below). To get it working in IE, get rid of this style:

...folderheader , .folderlist {
display:none;
}

It's pretty hard to click on something that is hidden from
the get go. Also, if you hide stuff with styles and the JS
doesn't work, you will never see anything.

Cheers, Rob.

<ul id="mainmenu">
<li id="level_1">< a href="#"
onclick="mClick (this)">Menu 1</a>
<ul class="folderhe ader">
<li id="level_2">< a href="#"
onclick="mClick (this)">Report Types</a>
<ul class="folderhe ader">
<li id="level_3">< a href="#"
onclick="mClick (this)">Reports 1</a>
<ul class="folderhe ader">
<li id="level_4">< a href="#"
onclick="mClick (this)">Report Name</a>
<ul class="folderli st">
<li>Add New Record</li>
<li>Edit Records</li>
<li>Clone Records</li>
</ul>
</li>
<li id="level_4">< a href="#"
onclick="mClick (this)">Report Name</a>
<ul class="folderli st">
<li>Add New Record</li>
<li>Edit Records</li>
<li>Mass Update</li>
<li>Clone Records</li>
</ul>
</li>
</ul>
</li>
<li id="level_3">< a href="#"
onclick="mClick (this)">Reports 2</a>
<ul class="folderhe ader">
<li id="level_4">< a href="#"
onclick="mClick (this)">Report Name</a>
<ul class="folderli st">
<li>Add New Record</li>
<li>Edit Records</li>
<li>Mass Update</li>
<li>Clone Records</li>
</ul>
</li>
<li id="level_4">< a href="#"
onclick="mClick (this)">Report Name</a>
<ul class="folderli st">
<li>Add New Record</li>
<li>Edit Records</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li id="level_1">< a href="#"
onclick="mClick (this)">Menu 2</a>
<ul class="folderhe ader">
<li id="level_2">< a href="#"
onclick="mClick (this)">Report Name</a>
<ul class="folderli st">
<li>Add New Record</li>
<li>Edit Records</li>
</ul>
</li>
</ul>
</li>
<li><a href="#" onclick="resetM enu();">Close menus</a></li>
</ul>

<script type="text/javascript">
resetMenu();
</script>
Jul 23 '05 #6
Thank you all. I got it. Great script. I changed, 0[i] to o[i]
because I couldn't fine 0 referenced...se emed to work both ways...not
sure why.

if (0[i] != n0) hideUL(o[i]);
if (o[i] != n0) hideUL(o[i]);

John

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 23 '05 #7
RobG <rg***@iinet.ne t.auau> wrote in message news:<Ay******* **********@news .optus.net.au>. ..
johkar N wrote:
Thank you for the reply. FYI, I did have to change childnodes to
childNodes in a couple of places. I don't fully understand this script
yet. When I tried to add even more submenus as in my original example,
it errored out. I am still looking at the script. Any pointers?


I simply applied Fred's

<a href="#" onclick="mClick (this)"> stuff </a>

to each header in your orginal stuff and it worked fine (see
below). To get it working in IE, get rid of this style:

..folderheader, .folderlist {
display:none;
}

It's pretty hard to click on something that is hidden from
the get go. Also, if you hide stuff with styles and the JS
doesn't work, you will never see anything.

Cheers, Rob.

<ul id="mainmenu">
<li id="level_1">< a href="#"
onclick="mClick (this)">Menu 1</a>
<ul class="folderhe ader">
<li id="level_2">< a href="#"
onclick="mClick (this)">Report Types</a>
<ul class="folderhe ader">
<li id="level_3">< a href="#"
onclick="mClick (this)">Reports 1</a>
<ul class="folderhe ader">
<li id="level_4">< a href="#"
onclick="mClick (this)">Report Name</a>
<ul class="folderli st">
<li>Add New Record</li>
<li>Edit Records</li>
<li>Clone Records</li>
</ul>
</li>
<li id="level_4">< a href="#"
onclick="mClick (this)">Report Name</a>
<ul class="folderli st">
<li>Add New Record</li>
<li>Edit Records</li>
<li>Mass Update</li>
<li>Clone Records</li>
</ul>
</li>
</ul>
</li>
<li id="level_3">< a href="#"
onclick="mClick (this)">Reports 2</a>
<ul class="folderhe ader">
<li id="level_4">< a href="#"
onclick="mClick (this)">Report Name</a>
<ul class="folderli st">
<li>Add New Record</li>
<li>Edit Records</li>
<li>Mass Update</li>
<li>Clone Records</li>
</ul>
</li>
<li id="level_4">< a href="#"
onclick="mClick (this)">Report Name</a>
<ul class="folderli st">
<li>Add New Record</li>
<li>Edit Records</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li id="level_1">< a href="#"
onclick="mClick (this)">Menu 2</a>
<ul class="folderhe ader">
<li id="level_2">< a href="#"
onclick="mClick (this)">Report Name</a>
<ul class="folderli st">
<li>Add New Record</li>
<li>Edit Records</li>
</ul>
</li>
</ul>
</li>
<li><a href="#" onclick="resetM enu();">Close menus</a></li>
</ul>

<script type="text/javascript">
resetMenu();
</script>


MY QUESTION ############### #####

Ok, I am back at this, I am having trouble getting the plus and minus
gifs to show at the appropriate time. I.E. Click on a node and it
turns to a minus. Click on a another node and all nodes with an ID
containing "level" in their name turn to a plus sign except for the
one you are on or its children. The ALL CAPS COMMENTS are where I am
currently trying to do this (incorrectly).

All help or pointers appreciated. John

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<style type="text/css">
#level_1, #level_2, #level_3, #level_4 {
cursor:pointer;
cursor:hand;
font-weight:normal;
list-style-image:url(plus. gif);
color:#003366;
padding-bottom:5px;
}
..folderlist {
list-style-image:url(repor t.gif);
}
LI {
padding-left:2px;
}
UL {
padding:5px;
}
</style>
<script language="javas cript" type="text/javascript">
var head="display:' '"
img1=new Image()
img1.src="plus. gif"
img2=new Image()
img2.src="minus .gif"

function showMenu(n){
// Go up to LI or UL, whichever comes first
// Will always be LI except on load when will be UL
while (n.nodeName != 'LI' && n.nodeName != 'UL') {
n = n.parentNode;
}

// remember node
var n0 = n;

// Go up to UL if stopped at LI above
while (n.nodeName != 'UL') {
n = n.parentNode;
}

// Make children of all sibling UL's hidden
// Do not hide kids of node clicked on
// to prevent flashing off & on
var o = n.childNodes;
for (var i=0; i<o.length; ++i) {
if (o[i] != n0){
hideUL(o[i]);
}
}

// Make children of node clicked on visible
for (var k=0; k<n0.childNodes .length; ++k) {
if (n0.childNodes[k].style){
n0.childNodes[k].style.display= '';
//THIS SEEMS TO WORK. FLIP THE NODE CLICKED ON TO A MINUS SIGN???
if(event && event.type=='cl ick')
n0.style.listSt yleImage="url(m inus.gif)";
}
}

}
function hideUL(x) {
// Hide UL
if (x.nodeName == 'UL'){
x.style.display ='none';
//HOW DO I GET THE OTHER NODES BACK TO A PLUS SIGN???
if(event && event.type=='cl ick')
x.style.listSty leImage="url(pl us.gif)";
}

// Recurse down tree, hiding all ULs
for (var j=0; j<x.childNodes. length; ++j) {
hideUL(x.childN odes[j]);
}
}
// Not really needed, see note below
function resetMenu() {
showMenu(docume nt.getElementBy Id("mainmenu")) ;
}
</script>
</head>
<body>
<ul id="mainmenu">
<li id="level_1"><s pan onclick="showMe nu(this)">Forec ast
Maintenance</span>
<ul class="folderhe ader">
<li id="level_2"><s pan onclick="showMe nu(this)">Input </span>
<ul class="folderhe ader">
<li id="level_3"><s pan onclick="showMe nu(this)">Quart erly
Maintenance</span>
<ul class="folderhe ader">
<li id="level_4"><s pan
onclick="showMe nu(this)">Charg eback Recovery
Accounts</span>
<ul class="folderli st">
<li>Add New Record</li>
<li>Edit Records</li>
<li>Clone Records</li>
</ul>
</li>
<li id="level_4"><s pan onclick="showMe nu(this)">FACT
Period</span>
<ul class="folderli st">
<li><a href="javascrip t:">Add New Record</a></li>
<li><a href="javascrip t:">Edit Records</a></li>
</ul>
</li>
<li id="level_4"><s pan
onclick="showMe nu(this)">Forec astable Centers</span>
<ul class="folderli st">
<li>Add New Record</li>
<li>Edit Records</li>
<li>Mass Update</li>
<li>Clone Records</li>
</ul>
</li>
<li id="level_4"><s pan onclick="showMe nu(this)">Forec ast
Rates</span>
<ul class="folderli st">
<li><a href="javascrip t:">Add New Record</a></li>
<li><a href="javascrip t:">Edit Records</a></li>
<li><a href="javascrip t:">Clone Records</a></li>
</ul>
</li>
<li id="level_4"><s pan onclick="showMe nu(this)">Rate
Description
&amp; Job Status</span>
<ul class="folderli st">
<li><a href="javascrip t:">Add New Record</a></li>
<li><a href="javascrip t:">Edit Records</a></li>
</ul>
</li>
</ul>
</li>
<li id="level_3"><s pan onclick="showMe nu(this)">Yearl y
Maintenance</span>
<ul class="folderhe ader">
<li id="level_4"><s pan onclick="showMe nu(this)">Accou nts
For New
Center Setup</span>
<ul class="folderli st">
<li><a href="javascrip t:">Add New Record</a></li>
<li><a href="javascrip t:">Edit Records</a></li>
<li><a href="javascrip t:">Mass Update</a></li>
<li><a href="javascrip t:">Clone Records</a></li>
</ul>
</li>
<li id="level_4"><s pan onclick="showMe nu(this)">Accru al
Periods</span>
<ul class="folderli st">
<li><a href="javascrip t:">Add New Record</a></li>
<li><a href="javascrip t:">Edit Records</a></li>
</ul>
</li>
<li id="level_4"><s pan onclick="showMe nu(this)">Amoun t
Type</span>
<ul class="folderli st">
<li><a href="javascrip t:">Add New Record</a></li>
<li><a href="javascrip t:">Edit Records</a></li>
</ul>
</li>
<li id="level_4"><s pan
onclick="showMe nu(this)">Autoc alculated Accounts</span>
<ul class="folderli st">
<li>Add New Record</li>
<li>Edit Records</li>
<li>Mass Update</li>
<li>Clone Records</li>
</ul>
</li>
<li id="level_4"><s pan onclick="showMe nu(this)">Forec ast
Account
Type</span>
<ul class="folderli st">
<li><a href="javascrip t:">Add New Record</a></li>
<li><a href="javascrip t:">Edit Records</a></li>
</ul>
</li>
<li id="level_4"><s pan
onclick="showMe nu(this)">Forec astable Accounts</span>
<ul class="folderli st">
<li><a href="javascrip t:">Add New Record</a></li>
<li><a href="javascrip t:">Edit Records</a></li>
<li><a href="javascrip t:">Mass Update</a></li>
<li><a href="javascrip t:">Clone Records</a></li>
</ul>
</li>
<li id="level_4"><s pan
onclick="showMe nu(this)">Forec asters/Reviewers</span>
<ul class="folderli st">
<li>Add New Record</li>
<li>Edit Records</li>
<li>Clone Records</li>
</ul>
</li>
<li id="level_4"><s pan onclick="showMe nu(this)">Job
Category</span>
<ul class="folderli st">
<li><a href="javascrip t:">Add New Record</a></li>
<li><a href="javascrip t:">Edit Records</a></li>
</ul>
</li>
<li id="level_4"><s pan onclick="showMe nu(this)">Rates
For Rate Driven
Accounts</span>
<ul class="folderli st">
<li>Add New Record</li>
<li>Edit Records</li>
<li>Mass Update</li>
<li>Clone Records</li>
</ul>
</li>
<li id="level_4"><s pan
onclick="showMe nu(this)">Relat ionship Between
Staff/Salary Type &amp; Accrual Basis</span>
<ul class="folderli st">
<li>Add New Record</li>
<li>Edit Records</li>
<li>Clone Records</li>
</ul>
</li>
<li id="level_4"><s pan
onclick="showMe nu(this)">Staff/Salary Type</span>
<ul class="folderli st">
<li><a href="javascrip t:">Add New Record</a></li>
<li><a href="javascrip t:">Edit Records</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li id="level_2"><s pan onclick="showMe nu(this)">Repor ting</span>
<ul class="folderhe ader">
<li id="level_3"><s pan onclick="showMe nu(this)">Forec ast
Iteration Log</span>
<ul class="folderli st">
<li><a href="javascrip t:">Add New Record</a></li>
<li><a href="javascrip t:">Edit Records</a></li>
</ul>
</li>
<li id="level_3"><s pan onclick="showMe nu(this)">Forec ast
Period</span>
<ul class="folderli st">
<li><a href="javascrip t:">Add New Record</a></li>
<li><a href="javascrip t:">Edit Records</a></li>
</ul>
</li>
<li id="level_3"><s pan onclick="showMe nu(this)">Forec ast
Type</span>
<ul class="folderli st">
<li><a href="javascrip t:">Add New Record</a></li>
<li><a href="javascrip t:">Edit Records</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li id="level_1"><s pan onclick="showMe nu(this)">Ledge r
Maintenance</span>
<ul class="folderhe ader">
<li id="level_2"><s pan onclick="showMe nu(this)">Inves tment
Segment Translation</span>
<ul class="folderli st">
<li><a href="javascrip t:">Add New Record</a></li>
<li><a href="javascrip t:">Edit Records</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<script>
resetMenu();
</script>
</body>
</html>
Jul 23 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2499
by: Alvaro G Vicario | last post by:
I have a list built on HTML and CSS: <ul> <li>Foo</li> <li>Bar <ul> <li>Gee</li> </ul> </li> </ul>
2
2675
by: Jenny | last post by:
My codebehind file contains a lot of sub's. Is there a fast way to expand and collapse them in the VisualStudio? It's really exhausting to collapse them all after opening the project in the morning! Thanks Jenny
0
2408
by: jim | last post by:
Hi, I have a TreeView control that sits on the MasterPage. All of my other webpages inherit from that Master Page. The Treeview receives it's data using an XMLDataSource that has it's DataFile property set to the Web.sitemap file. I have turned off the Expand/Collapse icons on the Treeview. I want to be able to single click a node in...
4
8340
by: Rabel | last post by:
I am not very good at javascript I mostly am a flash developer but I am trying to apply one of our old expanding menus to work for a new site but it doesn't collapse the way I need it to right now the code I am using looks like this function openSubCategory(n, nn) { var i = 0 for(i=1;i<n+1;i++) { var sel =...
3
5437
by: Irocivan | last post by:
Hello, I download a nice collapse menu for free distribution from the internet. It works very well except that none of the parents nodes are clickable (i.e. when clicking on the parent node, the link does not work). For example, if the below content is included in the html page, I would like that page www.fruit.com can be loaded whenever I click...
1
2781
by: pej.odonnell | last post by:
Hello everyone, 2 Issues: 1. When treeview renders all parent nodes are open? I want it to render closed? 2. When I try to collapse programmatically, it does not do anything? I'm using a tree view with a sitemap to create a menu. The treeview is contained in a master page. <asp:TreeView ID="TreeView1" runat="server"
0
1425
by: Marc Bartsch | last post by:
Hi, I have a WinForms application (C#, VS 2005) that consists of a treeview control and a notify icon. Below is a complete example of this application. The treeview has one root node and one child node. When I close the form, it will not be closed but minimised to the system tray. A double-click on the notify icon wakes it up and displays it...
0
2088
by: Homer J. Simpson | last post by:
A few weeks ago I asked for suggestions on how to persist a tree's node state to cookies, without causing postbacks on each click in the tree. I had a single .aspx file, with a row of buttons on top of the screen, and a tree control below (with EnableViewState set to true). I let the user expand/collapse away to his hearts content without...
0
7680
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7446
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7778
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6003
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5349
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3476
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3459
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1908
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
731
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.